package svn.project;

import java.io.File;

import org.tmatesoft.svn.core.io.SVNRepository;

import org.tmatesoft.svn.core.auth.BasicAuthenticationManager;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;

import org.tmatesoft.svn.core.wc.ISVNOptions;
import org.tmatesoft.svn.core.wc.SVNWCUtil;
import org.tmatesoft.svn.core.wc.SVNClientManager;

import org.tmatesoft.svn.core.wc.SVNCommitClient;
import org.tmatesoft.svn.core.wc.SVNCopyClient;
import org.tmatesoft.svn.core.wc.SVNDiffClient;
import org.tmatesoft.svn.core.wc.SVNLogClient;
import org.tmatesoft.svn.core.wc.SVNMoveClient;
import org.tmatesoft.svn.core.wc.SVNStatusClient;
import org.tmatesoft.svn.core.wc.SVNUpdateClient;
import org.tmatesoft.svn.core.wc.SVNWCClient;

public class SETClientManager {
	public SETClientManager(String url) {
		initSvnClientManger(url);
	}
	
	public void initSvnClientManger(String url) {
		String userName = SVNTools.getUserName();
		String userPwd = "111111";
		ISVNAuthenticationManager authManager = new BasicAuthenticationManager(userName, userPwd);
		ISVNOptions ioptions = SVNWCUtil.createDefaultOptions(new File("/"), true);
	    clientManger = SVNClientManager.newInstance(ioptions, authManager);	    
	}
	
	public SVNCommitClient getSVNCommitClient() {
		return clientManger.getCommitClient();
	}
	
	public SVNCopyClient getSVNCopyClient() {
		return clientManger.getCopyClient();
	}
	
	public SVNDiffClient getSVNDiffClient() {
		return clientManger.getDiffClient();
	}
	
	public SVNLogClient getSVNLogClient() {
		return clientManger.getLogClient();
	}
	
	public SVNMoveClient getSVNMoveClient() {
		return clientManger.getMoveClient();
	}
	
	public SVNStatusClient getSVNStatusClient(){
		return clientManger.getStatusClient();
	}
	
	public SVNUpdateClient getSVNUpdateClient() {
		return clientManger.getUpdateClient();
	}
	
	public SVNWCClient getSVNWCClient() {
		return clientManger.getWCClient();
	}
	
	public SVNRepository getSVNRepository() {
		return repository;
	}
	
	private SVNClientManager clientManger;
	private SVNRepository repository;
}
